import { post, get } from "utils/fetch";

const appDetail = (data) =>
  post(`/flow-platform/app/detail`, data, { messageType: "close" });
const appDelete = (data) => post(" /flow-platform/app/delete", data);
const busiDelete = (data) => post(" /flow-platform/busi/delete", data);
const appEdit = (data) => post("/flow-platform/app/edit", data);
const tenantList = (data) => post("/flow-platform/tenant/list", data);
const addApp = (data) =>
  post("/flow-platform/app/add", data, { messageType: "close" });
const addBusi = (data) =>
  post("/flow-platform/busi/add", data, { messageType: "close" });
const busiUpdate = (data) =>
  post("/flow-platform/busi/update", data, { messageType: "close" });
const authorizedUsersList = (data) =>
  post("/flow-platform/app/authorized/users", data);
const authorizeUser = (data) => post("/flow-platform/app/authorize/user", data);
const authorizeCancel = (data) =>
  post("/flow-platform/app/authorize/cancel", data);
const listTenantUsers = (data) =>
  get("/flow-platform/app/listTenantUsers", data, { messageType: "close" });

export default {
  appDetail,
  appDelete,
  appEdit,
  tenantList,
  addApp,
  addBusi,
  busiDelete,
  busiUpdate,
  authorizedUsersList,
  authorizeUser,
  authorizeCancel,
  listTenantUsers,
};
